home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / u_man / cat1 / regcmp.z / regcmp
Encoding:
Text File  |  2002-10-03  |  2.2 KB  |  67 lines

  1.  
  2.  
  3.  
  4. RRRREEEEGGGGCCCCMMMMPPPP((((1111))))                                                            RRRREEEEGGGGCCCCMMMMPPPP((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      regcmp - regular expression compile
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      rrrreeeeggggccccmmmmpppp [ ---- ] files
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      The _r_e_g_c_m_p command performs a function similar to _r_e_g_c_m_p(3X) and, in most
  16.      cases, precludes the need for calling _r_e_g_c_m_p(3X) from C programs.  This
  17.      saves on both execution time and program size.  The command _r_e_g_c_m_p
  18.      compiles the regular expressions in _f_i_l_e and places the output in _f_i_l_e....iiii.
  19.      If the ---- option is used, the output will be placed in _f_i_l_e....cccc.  The format
  20.      of entries in _f_i_l_e is a name (C variable) followed by one or more blanks
  21.      followed by a regular expression enclosed in double quotes.  The output
  22.      of _r_e_g_c_m_p is C source code.  Compiled regular expressions are represented
  23.      as eeeexxxxtttteeeerrrrnnnn cccchhhhaaaarrrr vectors.  _F_i_l_e....iiii files may thus be _i_n_c_l_u_d_e_d in C programs,
  24.      or _f_i_l_e....cccc files may be compiled and later loaded.  In the C program which
  25.      uses the _r_e_g_c_m_p output, _r_e_g_e_x(_a_b_c,_l_i_n_e) will apply the regular expression
  26.      named _a_b_c to _l_i_n_e.  Diagnostics are self-explanatory.
  27.  
  28. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  29.      name     "([A-Za-z][A-Za-z0-9_]*)$0"
  30.  
  31.      telno    "\({0,1}([2-9][01][1-9])$0\){0,1} *"
  32.               "([2-9][0-9]{2})$1[ -]{0,1}"
  33.               "([0-9]{4})$2"
  34.  
  35.      In the C program that uses the _r_e_g_c_m_p output,
  36.  
  37.           regex(telno, line, area, exch, rest)
  38.  
  39.      will apply the regular expression named _t_e_l_n_o to _l_i_n_e.
  40.  
  41. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  42.      regcmp(3G).
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.